package com.hm.shopping.domain;

import org.springframework.data.mongodb.core.index.CompoundIndex;
import org.springframework.data.mongodb.core.index.CompoundIndexes;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import com.hm.shopping.auto.su.BaseDomain;
import com.hm.shopping.auto.su.R;
import com.hm.shopping.def.NewsAnnouncementEnum;

import lombok.Getter;
import lombok.Setter;

/**
 * @author shishun.wang
 * @date 2018年1月17日 下午8:38:30
 * @version 1.0
 * @describe 新闻公告
 */
@Setter
@Getter
@Document(collection = R.Database.prefix + "NEWS_ANNOUNCEMENT")
@CompoundIndexes({ @CompoundIndex(name = "create_time,headlines,status", def = "{'create_time': 1,'headlines':1, 'status': 1}") })
public class NewsAnnouncementDomain extends BaseDomain {

	private static final long serialVersionUID = 1L;

	/**
	 * 新闻公告类型
	 */
	@Field(value = "news_announcement_type")
	private NewsAnnouncementEnum newsAnnouncement = NewsAnnouncementEnum.ANNOUNCEMENT;

	/**
	 * 新闻标题
	 */
	@Field(value = "news_name")
	private String newsName;
	
	/**
	 * 链接地址
	 */
	@Field(value = "link_uri")
	private String linkUri = "/404";

	/**
	 * 新闻简介
	 */
	private String introduction;

	/**
	 * 新闻内容
	 */
	private String content;

	/**
	 * 头条(第一条展示)
	 */
	private boolean headlines = false;

	/**
	 * 新闻展示顺序
	 */
	@Field(value = "news_order")
	private Integer newsOrder;
}
